import Axios from '../../lib/request'
import axios from 'axios'

//总收入金额
const getTotalRevenue = function () {
    return Axios.get('/tbOrder/getTotalRevenue')
}

//今日收入
const getTodayIncome = function () {
    return Axios.get('/tbOrder/getTodayIncome')
}

//7日收入
const getSevenIncome = function () {
    return Axios.get('/tbOrder/getSevenIncome')
}

//总入账
const getGeneralEntry = function () {
    return Axios.get('/tbOrder/getGeneralEntry')
}

//已结算
const getSettled = function () {
    return Axios.get('/tbOrder/getSettled')
}

//待结算
const getUnsettled = function () {
    return Axios.get('/tbOrder/getUnsettled')
}

//累计发放钻石
const queryGrant = function () {
    return Axios.get('/home/queryGrant')
}

//累计消耗钻石
const queryConsume = function () {
    return Axios.get('/home/queryConsume')
}


export const getFinanceInfo = function () {
    return axios.all([getTotalRevenue(), getTodayIncome(), getSevenIncome(), getGeneralEntry(), getSettled(), getUnsettled(), queryGrant(), queryConsume()])
};

//收入流水
export const queryRevenueFlow = function (data) {
    return Axios.post('/tbOrder/queryRevenueFlow', data)
}

/* 结算流水 */
//正在结算
export const queryInProgress = function (data) {
    return Axios.post('/tbOrder/queryInProgress', data)
}
//已结算
export const queryClosed = function (data) {
    return Axios.post('/tbOrder/queryClosed', data)
}

//查看结算单
export const queryStatement = function (orderNum) {
    return Axios.get('/tbOrder/queryStatement?orderNum=' + orderNum)
}


//退款流水
export const queryRefundFlow = function (data) {
    return Axios.post('/tbOrder/queryRefundFlow', data)
}


/* 钻石流水*/
//钻石收入
export const queryDiamondIncome = function (data) {
    return Axios.post('/tbOrder/queryDiamondIncome', data)
}
//钻石支出
export const queryDiamondExpenditure = function (data) {
    return Axios.post('/tbOrder/queryDiamondExpenditure', data)
}

/* 积分流水*/
export const intergalrecordList = function (data) {
    return Axios.post('/intergalrecord/list', data)
}
